#ifndef ROBOTSUBSYSTEM_H
#define ROBOTSUBSYSTEM_H

/**
 *  The RobotSubsystem class controls a subsystem of the robot.
 *  
 *  To use it, create subclasses that override the Init, Periodic, Continuous, and Disable functions.
 *  Then, create functions that control the subsystem that to be called by controllers.
 *  
 *  Every subsystem must be added to the SystematicRobot,
 *  which will call the functions at the correct times.
 *  
 *  Subsystems are enabled whenever the robot is enabled.
 *  
 *  Testing shows this class works.
 */
class RobotSubsystem
{
	// Befriend our robot class so it can call our functions.
	friend class SystematicRobot;
	
	public:
		RobotSubsystem();
	protected:
		virtual void HandleInitialize();
		virtual void HandleEnable();
		virtual void HandlePeriodic();
		virtual void HandleContinuous();
		
		/**
		 * This function must be overridden to disable this subsystem.
		 * It must be safe to call this function when already disabled.
		 */
		virtual void HandleDisable() = 0;
};

#endif // #ifndef ROBOTSUBSYSTEM_H 
